package com.tobie.info.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tobie.info.entity.HotelEntity;
import com.tobie.info.entity.RoomEntity;
import com.tobie.info.mapper.RoomMapper;
import com.tobie.info.service.IRoomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author lc
 * @Date 2023/11/20 9:35
 * @注释 房间信息实现类
 */
@Slf4j
@Service
public class RoomServiceImpl extends ServiceImpl<RoomMapper, RoomEntity> implements IRoomService {

    @Resource
    private RoomMapper roomMapper;

    @Override
    public List<RoomEntity> getAllRoom() {
        List<RoomEntity> roomEntities = this.baseMapper.selectList(null);
        log.info(roomEntities.toString());
        return roomEntities;
    }

    @Override
    public List<RoomEntity> getRoomByHotelName(String hotelName) {
        List<RoomEntity> roomEntities = roomMapper.getRoomByHotelName(hotelName);
        log.info(roomEntities.toString());
        return roomEntities;
    }
}
